Skip to content

fix: workaround netlify-cli not matching prod #2030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2023
Merged

fix: workaround netlify-cli not matching prod #2030

merged 2 commits into from
Apr 26, 2023

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Apr 5, 2023

Summary

On latest netlify-cli (13.2.2) running netlify serve fails with

Cannot read properties of undefined (reading 'odb_refresh_hooks')

My assumption is that we are not getting custom context in event handlers when running locally, so this just allows to run it locally for now

Test plan

  1. Visit the Deploy Preview (insert link to specific page) ...

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/6448d0da42610500088e73b3
😎 Deploy Preview https://deploy-preview-2030--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/6448d0daaebb98000878087e
😎 Deploy Preview https://deploy-preview-2030--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Apr 5, 2023
@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6448d0dac22cf6000886b1f7
😎 Deploy Preview https://deploy-preview-2030--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/6448d0daec8602000805bb50
😎 Deploy Preview https://deploy-preview-2030--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6448d0daec8602000805bb46
😎 Deploy Preview https://deploy-preview-2030--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6448d0da4eec0e0008fce2c2
😎 Deploy Preview https://deploy-preview-2030--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/6448d0dad022a10008cb9596
😎 Deploy Preview https://deploy-preview-2030--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6448d0da9555c30008bb2695
😎 Deploy Preview https://deploy-preview-2030--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 7d8f81c
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6448d0daec8602000805bb4b
😎 Deploy Preview https://deploy-preview-2030--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@nickytonline
Copy link

Do refresh hooks work locally @orinokai or is it like ISR pages with netlify serve?

@pieh
Copy link
Contributor Author

pieh commented Apr 6, 2023

Do refresh hooks work locally @orinokai or is it like ISR pages with netlify serve?

From my manual local tests it looks like ODB doesn't act as ODB with netlify serve and rather as regular function locally, so it is always re-rendered (so no caching behavior) so that alone will mean refresh hook wouldn't have any effect even if it didn't throw somewhere along the way.

Also refresh is done via hitting Netlify API and specifying hostname which would be just localhost:8888 so Netlify platform wouldn't even know what to do about that (?) - https://github.com/netlify/next-runtime/blob/019b6b13b1d1d0ebf907e78e1b9c8833158fec9b/packages/runtime/src/templates/server.ts#L52-L61

@orinokai
Copy link
Contributor

Thanks for this @pieh, and yes you're right, ISR currently doesn't work locally (I'd like this to work, but we'd have to implement the ODB cache locally and ensure it has feature parity with production) so this fix is a good workaround for now.

@LekoArts LekoArts marked this pull request as ready for review April 26, 2023 07:21
@LekoArts LekoArts requested a review from a team April 26, 2023 07:21
@kodiakhq kodiakhq bot merged commit fd29ea5 into main Apr 26, 2023
@kodiakhq kodiakhq bot deleted the pieh-patch-1 branch April 26, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants